<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* class this */
        // 在class和构造函数中 this指向使用new关键字实例化的对象
        class Person {
            skill = "lisissss"
            constructor(name, age) {
                this.name = name
                this.age = age
                console.log(this);
            }
        }
        var p = new Person('lisi',18);
        console.log(p.name);
    </script>
</body>

</html>